package simorg.actions;

import org.dom4j.Document;

import simorg.controller.AdminController;
import simorg.view.ModelView;
import simorg.view.Page;
import simorg.view.SessionAttribute;
import simorg.view.WebSessionContext;

public class AdminLogout extends Action {

	public static final String actionName = "logout";
	public AdminLogout() {
		super(actionName);
		this.controllerName = AdminController.controllerName;
	}
	
	@Override
	public ModelView process(WebSessionContext wc) throws Exception {
		wc.setSessionAttribute(SessionAttribute.User, null);
		Document xmlDoc = this.getBaseXml(wc);
		return new ModelView(Page.AdminLogin, xmlDoc);
	}

}
